package com.xmy.cultivate.controller;

import com.xmy.cultivate.entity.GradeAutoSet;
import com.xmy.cultivate.service.IGradeAutoSetService;
import com.xmy.cultivate.util.Code;
import com.xmy.cultivate.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 批量添加班级设置 前端控制器
 * </p>
 *
 * @author hpiggy
 * @since 2024-12-10
 */
@RestController
@RequestMapping("/api/gradeAutoSet")
@Scope("prototype")
public class GradeAutoSetController {

    @Autowired
    IGradeAutoSetService iGradeAutoSetService;

    @PostMapping("/createGradeAuto")
    public Result createGradeAuto(@RequestBody GradeAutoSet gradeAutoSet){
        iGradeAutoSetService.createGradeAuto(gradeAutoSet.getYearPart(),gradeAutoSet.getQuarterNum(),gradeAutoSet.getSchoolId(),gradeAutoSet.getYearClasId(),gradeAutoSet.getType());
        return new Result(Code.OK, "", "创建中……");
    }

}
